package receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import application.UIApplication;

/**
 * Created by yanglei on 16/12/12.
 */
public abstract class SignalrReceiver extends BroadcastReceiver {
    public static final String Action = UIApplication.PackageName+".Receiver.SignalrHandle";
    @Override
    public void onReceive(Context context, Intent intent) {
        if (Action.equals(intent.getAction())){
            String action = intent.getStringExtra("action");
            String data = intent.getStringExtra("data");
            SignalrHandle(context, intent, action,data);
        }
    }

    /**
     * signalr处理
     * @param context
     * @param intent
     * @param action
     * @param data
     */
    public abstract void SignalrHandle(Context context, Intent intent,String action,String data);
}
